package com.heritage.repository;

import com.heritage.entity.Like;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

public interface LikeRepository extends JpaRepository<Like, Long> {
    Optional<Like> findByUserIdAndHeritageId(Long userId, Long heritageId);
    boolean existsByUserIdAndHeritageId(Long userId, Long heritageId);
    int countByHeritageId(Long heritageId);
    void deleteByUserIdAndHeritageId(Long userId, Long heritageId);
}
